package service_gin

import (
	"github.com/gin-gonic/gin"
)

func (g *GinService) ListFruitsService(c *gin.Context) {

	ret, err := g.GinBiz.ListFruitsBiz(c)

	if err != nil {
		c.JSON(500, gin.H{
			"msg": "error",
			"data": gin.H{
				"error": err,
			},
		})
		return
	}

	c.JSON(200, gin.H{
		"msg": "success",
		"data": gin.H{
			"fruits": ret,
		},
	})

}
